package user;

import lecture.Lecture;

/**
 *
 * @author Thorsten Ludwig
 */
public class UserRoleContainer {
    
    private User user;
    private Role role;
    private Lecture lecture;

    public UserRoleContainer(User user, Role role, Lecture lecture) {
        this.user = user;
        this.role = role;
        this.lecture = lecture;
    }

    public Role getRole() {
        return user.getUserRole(lecture.getInfo().getName());
    }

    public void setRole(Role role) {
        this.role = role;
        user.assignRole(lecture.getInfo().getName(), role);
    }

    public User getUser() {
        return this.user;
    }
}
